﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>Untitled Page</title>
</head>
<body>

<script   language= "JavaScript"> 

var   objdbConn   =   new   ActiveXObject( "ADODB.Connection"); 

objdbConn.Open("DBQ=K:\\DATA1.mdb;DRIVER={Microsoft Access Driver (*.mdb)};");

var   objrs   =   objdbConn.Execute( "SELECT   *   FROM   birthday"); 

var   fdCount   =   objrs.Fields.Count   -   1; 
if   (!objrs.EOF){ 
    document.write( " <table   border=1> <tr> ");       
    for   (var   i=0;   i   <=   fdCount;   i++) 
            document.write( " <td> <b> "   +   objrs.Fields(i).Name   +   " </b> </td> "); 
    document.write( " </tr> "); 
    
    while   (!objrs.EOF){ 
        document.write( " <tr> ");           
        for   (i=0;   i   <=   fdCount;   i++) 
              document.write( " <td   valign= 'top '> "   +   objrs.Fields(i).Value   +   " </td> "); 
        document.write( " </tr> "); 
        objrs.moveNext();     //   移到下一笔记录 
    } 
    document.write( " </table> ");   
} 
else   
    document.write( "数据库内没有记录! <br> "); 
objrs.Close();                 //   关闭记录集合 
objdbConn.Close();         //   关闭数据库链接 
</script> 



</body>
</html>
